package com.community.zhihuishequ.view.defense;

import android.content.Intent;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.design.widget.AppBarLayout;
import android.support.v7.widget.Toolbar;
import android.view.MenuItem;
import android.widget.ImageView;
import android.widget.TextView;

import com.community.zhihuishequ.R;
import com.community.zhihuishequ.view.base.BaseActivity;

import butterknife.BindView;
import butterknife.ButterKnife;

public class DefenseAvtivity extends BaseActivity {

    @BindView(R.id.toolBar)
    Toolbar toolBar;
    @BindView(R.id.appBarLayout)
    AppBarLayout appBarLayout;
    @BindView(R.id.img_normal)
    ImageView imgNormal;
    @BindView(R.id.alarm_detail_region_name)
    TextView alarmDetailRegionName;
    @BindView(R.id.alarm_detail_camera_name)
    TextView alarmDetailCameraName;
    @BindView(R.id.alarm_detail_event_type_title)
    TextView alarmDetailEventTypeTitle;
    @BindView(R.id.alarm_detail_event_type)
    TextView alarmDetailEventType;

    private String defenseName;
    private String monitoryPoint;

    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_defense);
        unbinder = ButterKnife.bind(this);
        initActionBar(toolBar, true);
        toolBar.setNavigationIcon(R.drawable.ic_back);

        initData();
        initView();
    }

    private void initData() {
        Intent intent = getIntent();
        if (intent != null) {
            defenseName = intent.getStringExtra("defenseName");
            monitoryPoint = intent.getStringExtra("monitoryPoint");
        }
    }

    private void initView() {
        alarmDetailRegionName.setText(defenseName);
        alarmDetailCameraName.setText(monitoryPoint);
    }

    @Override
    public boolean onOptionsItemSelected(MenuItem item) {
        if (item.getItemId() == android.R.id.home) {
            finish();
        }
        return super.onOptionsItemSelected(item);
    }
}
